package models

import "gorm.io/gorm"

type Video struct {
	gorm.Model
	Title     string `gorm:"type:varchar(50)" json:"title"`
	Content   string `gorm:"type:text" json:"content"`
	Author    string `gorm:"type:varchar(50)" json:"author"`
	LikeCount int    `gorm:"type:int" json:"like_count"`
	UserId    int    `gorm:"type:int" json:"user_id"`
	User      User   `gorm:"foreignKey:UserId" json:"user"`
}

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(50)" json:"username"`
	Password string `gorm:"type:varchar(255)" json:"password"`
}

type Like struct {
	gorm.Model
	VideoId int   `gorm:"type:int" json:"video_id"`
	Video   Video `gorm:"foreignKey:VideoId" json:"video"`
	UserId  int   `gorm:"type:int" json:"user_id"`
	User    User  `gorm:"foreignKey:UserId" json:"user"`
}
